package com.yl.auth.controller;

import com.yl.auth.entity.XinzimingxiBean;
import com.yl.auth.service.XinzimingxiService;
import com.yl.common.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Api(tags = "薪资明细")
@RestController
@RequestMapping("/admin/caiwushouzhi/xinzimingxi")
public class XinzimingxiController {
    @Resource
    private XinzimingxiService xinzimingxiService;

    @ApiOperation(value = "全查")
    @GetMapping("/findAll/{id}")
    public Result<List<XinzimingxiBean>> findAll(@PathVariable Long id) {
        List<XinzimingxiBean> list = xinzimingxiService.getAll(id);
        return Result.ok(list);
    }

    @ApiOperation(value = "根据id查询")
    @GetMapping("/getOne/{id}")
    public Result getOne(@PathVariable Long id) {
        XinzimingxiBean xinzimingxiBean = xinzimingxiService.getXinzi(id);
        return Result.ok(xinzimingxiBean);
    }
}
